<template>
  <div>
    <h2>开户页面</h2>
    账号姓名：<el-input v-model="account.name" style="width: 200px"></el-input><br>
    账号：<el-input v-model="account.number" style="width: 200px"></el-input><br>
    <el-button @click="addAc">开户</el-button>
  </div>
</template>

<script>
export default {
  name: 'AddacView',
  data () {
    return {
      account: {
        name: '',
        number: '',
        beginTime: ''
      }
    }
  },
  methods: {
    addAc () {
      this.account.beginTime = new Date()
      this.axios.post('/account/addAc', this.account)
        .then(res => {
          if (res.data.code === 200) {
            this.$message.success('开户成功')
            this.$router.push('/account')
          } else {
            this.$message.success('开户失败')
          }
        })
    }
  }
}
</script>

<style scoped>

</style>
